import request from '@/utils/request'

// 查询火车车站列表
export function listTrainStation(query) {
  return request({
    url: '/base/train-station/list',
    method: 'get',
    params: query
  })
}

// 查询火车车站详细
export function getTrainStation(id) {
  return request({
    url: '/base/train-station/' + id,
    method: 'get'
  })
}

// 新增火车车站
export function addTrainStation(data) {
  return request({
    url: '/base/train-station',
    method: 'post',
    data: data
  })
}

// 修改火车车站
export function updateTrainStation(data) {
  return request({
    url: '/base/train-station',
    method: 'put',
    data: data
  })
}

// 删除火车车站
export function delTrainStation(id) {
  return request({
    url: '/base/train-station/' + id,
    method: 'delete'
  })
}

// 获取指定列车的所有站点（不分页）
export function listAllStationsByTrainCode(trainCode) {
  return request({
    url: '/base/train-station/listAllByTrainCode/' + trainCode,
    method: 'get'
  })
}

// 清空火车站点数据
export function clearTrainStation(data) {
  return request({
    url: '/base/train-station/clear',
    method: 'post',
    data: data
  })
}